// 多个界面复用的逻辑 要抽离成hooks
import { getQuestionService } from '../services/question'
import { useParams } from 'react-router-dom'
import {useRequest} from 'ahooks'
const useLoadQuestionData = () => {
    const {id = ''} = useParams()
    async function load() {
        const data = await getQuestionService(id)
        return data
    }
    const { data, error,loading } = useRequest(load)
 return {data,loading,error}
}

export default useLoadQuestionData